package com.liuxing.doctor.mapper;

import com.liuxing.doctor.entity.Inspection;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

@Mapper
public interface InspectionMapper {
    int deleteByPrimaryKey(Integer inspectionId);

    int insert(Inspection record);

    int insertSelective(Inspection record);

    Inspection selectByPrimaryKey(Integer inspectionId);

    int updateByPrimaryKeySelective(Inspection record);

    int updateByPrimaryKey(Inspection record);
    /**
     * 查询病人检查单的基本信息
     * @param patient_id
     * @return
     */
    List<Inspection> selectByPatientId(String patient_id);

    /**
     * 根据检查id查询检查项目
     * @param inspectionId
     * @return
     */
    Inspection selectByInspectionId(String inspectionId);

    /**
     * 插入一条信息检查项目
     * @param map
     * @return
     */
    Integer insertOneInspectionProject(Map<String,Object> map);

    /**
     * 根据存在的检查id更新部分基本信息
     * @param map
     * @return
     */
    Integer updateOneInspectionProjectById(Map<String,Object> map);

    /**
     * 查询最近一条插入数据的id
     * @return
     */
    Integer selectLastInsertId();

    /**
     * 删除一条记录
     * @param inspectionId 检查项目id
     * @return
     */
    int deleteOneInspectionProjectById(String inspectionId);
}